package com.example.hello;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.TextView;

public class ScoreActivity extends AppCompatActivity {
    public  static  final  String TAG="fenshu";
    public  static  final  String TAG2="jiafen";
    TextView score;
    String s1;
    Integer s2;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_score);

        score=findViewById(R.id.score);
        s1=score.getText().toString();
        s2=Integer.parseInt(s1);
        Log.i(TAG,"onCreate():score="+s2);
    }
    public void click1(View v) {
        s2=s2+3;
        s1=String.valueOf(s2);
        Log.i(TAG,"click1():score="+s2);
        score.setText(s1);
    }
    public void click2(View v) {
        s2=s2+2;
        s1=String.valueOf(s2);
        Log.i(TAG,"click1():score="+s2);
        score.setText(s1);
    }
    public void click3(View v) {
        s2=s2+1;
        s1=String.valueOf(s2);
        score.setText(s1);
    }
    public void click4(View v) {
        s2=0;
        s1=String.valueOf(s2);
        score.setText(s1);
    }
}